{include file="public/layout" /}

<body class="ad_postion bodystyle" style="overflow-y: scroll;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page min-hg-c-10">
    <form class="form-horizontal" id="post_form">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit"> <label for="title"><em>*</em>广告名称</label> </dt>
                <dd class="opt">
                    <input type="text" name="title" value="{$field.title}" id="title" onkeyup="detectionTitleRepeat(this);" onchange="detectionTitleRepeat(this);" class="input-txt" autocomplete="off">
                    <p class="notic2 red" id="title_tips"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit"> <label>广告类型</label> </dt>
                <dd class="opt">
                    <input type="hidden" name="type" value="{$field.type}"> {$field.type_name} 
                </dd>
            </dl>

            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_1" style="z-index: 2">
                <dt class="tit"> <label>广告内容</label> </dt>
                <dd class="opt">
                    <div class="tab-pane" id="tab_imgupload">
                        <table class="table table-bordered">
                            <tbody>
                                <tr>
                                    <td>
                                        <div class="sort-list">
                                            {volist name="ad_data" id="vo" key="k"}
                                            {eq name="$vo.media_type" value="1"}
                                            <div class="images_upload">
                                                <div class="ic">
                                                    <div class='upimg' title="拖动修改排序" onmouseover="upimgMouseover(this);" onmouseout="upimgMouseout(this);">
                                                        <div class='icaction' style="display: none" >
                                                            <span class="load_images" onclick="Images('{$vo.litpic}', 900, 600);">
                                                                <a href="javascript:void(0);" style="color:white">
                                                                    <i class='fa fa-search-plus'></i>大图
                                                                </a>
                                                            </span>
                                                            <span class="load_images" onclick="loadImagesId({$vo.id});">
                                                                <i class='fa fa-photo'></i>更换
                                                            </span>
                                                            <span class="load_images" onclick="showInput({$vo.id});">
                                                                <i class='fa fa-file-text-o'></i>信息
                                                            </span>
                                                        </div>
                                                        <div class='cover-bg' style="display: none" ></div>
                                                        <img id="{$vo.id}_Id" src="{$vo.litpic}"/>
                                                        <a class="delect" href="javascript:void(0);" onclick="clearPicArr(this, '{$vo.litpic}', {$vo.id});" title="删除"></a>
                                                    </div>

                                                    <div class="load_input" id="{$vo.id}_ShowInput" data-showOrHide="hide">
                                                        <input type="hidden" name="img_id[]" value="{$vo.id}"/>
                                                        <span class="span_input">
                                                            <input type="hidden" id="{$vo.id}_Litpic" name="img_litpic[]" value="{$vo.litpic}"/>
                                                        </span>
                                                        <textarea name="img_title[]" placeholder="请输入标题..." style="height: 28px;">{$vo.title}</textarea>
                                                        <textarea name="img_links[]" placeholder="请输入链接网址..." style="height: 28px;">{$vo.links}</textarea>
                                                        <textarea name="img_intro[]" placeholder="广告注释：支持HTML代码" style="height: 64px;">{$vo.intro}</textarea>
                                                        <div class="operation">
                                                            <a href="javascript:void(0);">
                                                                <label>
                                                                    <input type="checkbox" {eq name="$vo.target" value="1"} checked="checked" {/eq} title="在新窗口打开" onclick="checkedTarget(this)"/>新窗口
                                                                    <input type="hidden" name="img_target[]" value="{$vo.target}">
                                                                </label>
                                                            </a>
                                                            <a href="javascript:void(0);" onclick="copyToClipBoard({$vo.id});">
                                                                <i class="fa fa-file-code-o"></i>标签调用
                                                            </a>
                                                            <a onclick="showInput({$vo.id});" style="width: 32%;" href="javascript:void(0);" title="收回"><i style="font-size:16px;" class="fa fa-angle-double-up"></i></a>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            {/eq}
                                            {/volist}
                                            <div class="images_upload"></div>
                                        </div> 
                                        <a href="javascript:void(0);" onClick="GetUploadify(30, '', 'allimg', 'imgupload_call_back');" class="img-upload b-img-upload mb15" title="点击上传"><div class="y-line"></div><div class="x-line"></div></a>
                                        <input type="hidden" id="ImagesId">
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <!-- 上传图片显示的样板 start -->
                    <div class="images_upload_tpl none">
                        <div class="images_upload ic">
                            <div class="ic">
                                <div class='upimg' title="拖动修改排序" onmouseover="upimgMouseover(this);" onmouseout="upimgMouseout(this);">
                                    <div class='icaction' style="display: none">
                                        <span class="load_images" onclick="">
                                            <a href="javascript:void(0);" style="color: white"><i class='fa fa-search-plus'></i>大图</a>
                                        </span>
                                        <span class="load_images" onclick="">
                                            <i class='fa fa-file-text-o'></i>信息
                                        </span>
                                    </div>
                                    <div class='cover-bg' style="display: none"></div>
                                    <img src="__STATIC__/admin/images/add-button.jpg"/>
                                    <a class="delect" href="javascript:void(0);" title="删除"></a>
                                </div>

                                <div class="load_input" data-showOrHide="hide">
                                    <input type="hidden"/>
                                    <span class="span_input"> <input type="hidden"/> </span>
                                    <textarea placeholder="请输入标题..." style="height: 28px;"></textarea>
                                    <textarea placeholder="请输入链接网址..." style="height: 28px;"></textarea>
                                    <textarea placeholder="广告注释：支持HTML代码" style="height: 64px;"></textarea>
                                    <div class="operation">
                                        <a href="javascript:void(0);">&nbsp;&nbsp;</a>
                                        <a href="javascript:void(0);">&nbsp;&nbsp;</a>
                                        <a style="width: 32%;" href="javascript:void(0);">&nbsp;&nbsp;</a>
                                    </div> 
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 上传图片显示的样板 end -->
                </dd>
            </dl>

            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_2" style="z-index: 2">
                <dt class="tit"> <label>广告内容</label> </dt>
                <dd class="opt">
                    <input type="hidden" name="video_id" {eq name="$ad_data.0.media_type" value="2"} value="{$ad_data.0.id}" {/eq} class="input-txt">
                    <input type="text" name="video_litpic" id="video_litpic" {eq name="$ad_data.0.media_type" value="2"} value="{$ad_data.0.litpic}" {/eq} class="input-txt">
                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green " id="videoUploadLitpicLocal" onclick="$('#courseware_file').attr('data-type', 'local').trigger('click');">本地上传</a>
                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="previewVideo" onclick="openPreviewVideo();">预览</a>
                </dd>
            </dl>

            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_3" style="z-index: 2">
                <dt class="tit"> <label>广告内容</label> </dt>
                <dd class="opt">
                    <input type="hidden" name="html_id" {eq name="$ad_data.0.media_type" value="3"} value="{$ad_data.0.id}" {/eq} class="input-txt">
                    <textarea rows="5" cols="60" id="html_intro" name="html_intro" style="height: 200px;">{eq name="$ad_data.0.media_type" value="3"}{$ad_data.0.intro}{/eq}</textarea>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit"> <label>备注信息</label> </dt>
                <dd class="opt"><textarea rows="5" cols="60" id="intro" name="intro" style="height:60px;">{$field.intro}</textarea></dd>
            </dl>

            <div class="bot">
                <input type="hidden" name="id" id="1615775137_id" value="{$field.id}">
                <a href="JavaScript:void(0);" onclick="submitForm('#post_form');" class="ncap-btn-big ncap-btn-green">保存</a>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
    var selectedType = '{$field.type}';
    var mediaType = "{$media_type}";
    var uploadMaxFilesize = "{$upload_max_filesize}";
    var del_imgupload = "{:url('Pc/del_imgupload')}";
    var open_preview_video = "{:url('Pc/open_preview_video')}";
    var upVideo = "{:url('Ueditor/upVideo', ['savepath' => 'media'])}";
    var detection_title_repeat = "{:url('AdPosition/detection_title_repeat', ['_ajax'=>1])}";
    var submitFormUrl = "{:url('Pc/avd_edit', ['_ajax'=>1])}";

    // 代码调用js
    function copyToClipBoard(id) {
        var adstr = "{eyou:ad aid='" + id + "'}\r\n   <a href='{$"+"field.links}' {$"+"field.target}><img src='{$"+"field.litpic}' alt='{$"+"field.title}' /></a>\r\n   广告注释：{$"+"field.intro}\r\n{/eyou:ad";
        var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px"><dd>标签 ad 调用:</dd>';
        contentdiv += '<textarea rows="4" cols="60" style="width:400px;height:100px;">' + adstr + '}</textarea>';
        contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将对应标签代码复制并粘贴到对应模板文件中！</dd></dl></div>';
        layer.open({
            title: '代码调用',
            type: 1,
            shade: layer_shade,
            skin: 'layui-layer-demo',
            area: ['480px', '260px'], //宽高
            content: contentdiv
        });
    }
</script>
<script type="text/javascript" src="__SKIN__/js/admin_ad_position.js?v={$version}"></script>
{include file="public/footer" /}